<%--
  Created by IntelliJ IDEA.
  User: 蔡岳衡
  Date: 2016/8/22
  Time: 17:59
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:set var="path" value="${pageContext.request.contextPath}"/>
<title>数据库信息</title>
<p>
<div class="row">
	<!-- 搜索条件部分begin -->
	<div class="research_content_col col-xs-12 col-sm-12">
		<form action="" id="databaseSearchForm">
			<div class="form-group col-xs-12 col-sm-3 researchInput">
				<label class="col-xs-3 col-sm-4 col-lg-3 control-label">数据库名</label>
				<div class="col-xs-9 col-sm-8 col-lg-9 control-input">
					<input class="form-control" placeholder="请输入数据库名..."
						   type="text" name="Q_p.name_like">
				</div>
			</div>
			<div class="form-group col-xs-12 col-sm-3 researchInput">
				<label class="col-xs-3 col-sm-4 col-lg-3 control-label">中文名</label>
				<div class="col-xs-9 col-sm-8 col-lg-9 control-input">
					<input class="form-control" placeholder="请输入中文名..."
						   type="text" name="Q_p.nameCn_like">
				</div>
			</div>
			<div class="form-group col-xs-6 col-sm-3 researchSelect">
				<label class="col-xs-3 col-sm-4 col-lg-3 control-label">编码</label>
				<div class="col-xs-9 col-sm-8 col-lg-9 control-select">
					<select id="dbCode" name="Q_p.databaseCode_=_short" class="select2" data-placeholder="请选择编码...">
					</select>
				</div>
			</div>
			<input type="text" name="Q_p.versionId_=_Long" id="databaseVersion"
				   class="sun-form-input form-control hide" value="-1"/>
		</form>
	</div>
	<!-- 搜索条件部分end -->
</div>
</p>

<div class="row">
	<div class="col-xs-12">
		<p>
		<div class="row">
			<div class="col-xs-12 col-sm-12">
				<button id="databaseSearch" type="button"
						class="btn btn-success btn-sm" onclick="database.searchDatabase(false)">
					<span class="glyphicon glyphicon-search"></span>&nbsp;&nbsp;查询
				</button>
				<button id="databaseClear" type="button"
						class="btn btn-info btn-sm" onclick="database.clearDbSearchFrom()">
					<span class="glyphicon glyphicon-remove"></span>&nbsp;&nbsp;清空查询
				</button>
				<button id="databaseAdd" type="button"
						class="btn btn-primary btn-sm" onclick="database.openWinDbAddOrEdit(true)">
					<span class="glyphicon glyphicon-plus"></span>&nbsp;&nbsp;新增
				</button>
				<button id="databaseModify" type="button"
						class="btn btn-warning btn-sm" onclick="database.openWinDbAddOrEdit(false)">
					<span class="glyphicon glyphicon-pencil"></span>&nbsp;&nbsp;修改
				</button>
				<button id="databaseDelete" type="button"
						class="btn btn-danger btn-sm" onclick="database.delDatabase()">
					<span class="glyphicon glyphicon-trash"></span>&nbsp;&nbsp;删除
				</button>
			</div>
		</div>
		<%--按钮部分结束--%>
		<p>
		<div class="row">
			<div class="col-xs-12 col-sm-12" style="overflow: hidden;">
				<table id="databaseJqgridTable"></table>
				<div id="databaseJqgridPager"></div>
			</div>
		</div>
	</div>
</div>

<%--新增数据库弹窗部分start--%>
<div class="modal-content" id="databaseAddModal" style="display: none; padding: 10px;">
	<form id="databaseAddOrEditForm" action="">
		<table class="sun-form-table">
			<tr>
				<td><input type="text" name="id" class="sun-form-input form-control hide"/></td>
				<td><input type="text" name="createTime" class="sun-form-input form-control hide"/></td>
				<td><input type="text" name="modifyTime" class="sun-form-input form-control hide"/></td>
				<td><input type="text" name="createAccountId" class="sun-form-input form-control hide"/></td>
				<td><input type="text" name="modifyAccountId" class="sun-form-input form-control hide"/></td>
				<td><input type="text" name="script" class="sun-form-input form-control hide"/></td>
				<td><input type="text" name="versionId" class="sun-form-input form-control hide"/></td>
			</tr>
			<tr>
				<th>英文名</th>
				<td><input type="text" name="name" class="sun-form-input form-control"
				           required="required"/></td>
			</tr>
			<tr>
				<th>中文名</th>
				<td><input type="text" name="nameCn" class="sun-form-input form-control"
				           required="required"/></td>
			</tr>
			<tr>
				<th>编码</th>
				<td>
					<select name="databaseCode" class="select2 form-control sun-form-select" id="addDbCode"
					        required="required"
					        style="padding-top: 0px;">
					</select>
				</td>
			</tr>
			<tr>
				<th>描述</th>
				<td colspan="4"><textarea rows="4" cols="1" name="remark" class="sun-form-input form-control"
										  id="remark"></textarea></td>
			</tr>
		</table>
	</form>
</div>
<%--新增数据库弹窗部分end--%>

<script type="text/javascript">

	var scripts = [
		null,
		path + '/admin/powerdb/designer/database/js/database.js',
		path + '/admin/powerdb/designer/pdm/js/pdmOpenWin.js',
		null
	];

	$('.page-content-area').ace_ajax('loadScripts', scripts, function () {
		$(document).ready(function () {
			database.init();
		});
	});
</script>

